package phone.qyg.com.qyg.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 作者：lblbh on 2017/3/17 17:42
 * 邮箱：lanbuhan@163.com
 * 功能：轮播
 */
public class Roll implements Parcelable {

    public int id;
    public int type;
    public int objectId;
    public String title;
    public String content;
    public String sourceUrl;
    public String fixImgUrl;
    public String createDate;

    /**
     *
     "id": 1,//稿件id
     "fixImgUrl": "http://domain:port/data/profile/jpg/2017/03/10/dswee23.jpg", //小缩略图
     "sourceUrl": "http://domain:port/mobi/fittrain/coursedetail?course_id=1", //稿件来源地址
     “type”: 1     //轮播图类型：0-普通（无链接）1-网页链接，2-活动，3-场馆，4-专题，5-课程
     “objectId”: 21   //对象ID（活动，场馆，专题，课程）
     */


    /**
     *文化超市 详情 图片集合
     "content": "2",//图片描述
     "id": 1,//图片id
     "fixImgUrl": "http://47.92.89.32:8010/atta/data/resource/resinfo/thumb/2017/12/06/d2aef0c7-8656-4684-90ba-761c478044f4_1248x872.jpg" //缩略图

     */

    public Roll() {}

    @SuppressWarnings("unchecked")
    public Roll(Parcel in) {
        id = in.readInt();
        type = in.readInt();
        objectId = in.readInt();
        title = in.readString();
        content = in.readString();
        fixImgUrl = in.readString();
        createDate = in.readString();
        sourceUrl = in.readString();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeInt(type);
        dest.writeInt(objectId);
        dest.writeString(title);
        dest.writeString(content);
        dest.writeString(fixImgUrl);
        dest.writeString(createDate);
        dest.writeString(sourceUrl);

    }


    public static final Creator<Roll> CREATOR = new Creator<Roll>() {
        @Override
        public Roll[] newArray(int size) {
            return new Roll[size];
        }

        @Override
        public Roll createFromParcel(Parcel in) {
            return new Roll(in);
        }
    };
}
